﻿/*
 *  Author: Louis A. Leskoviansky
 *  Company: Artemis Solutions Group (http://www.artemis-solutions.com)
 */


using System;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Linq;
using System.Web;


namespace AjaxControlFramework.Compilation
{
    public class JavaScriptCodeDom
    {
        //------// Properties \\--------------------------------------------\\
        private JavaScriptSourceElementCollection _sourceElements = null;
        public virtual JavaScriptSourceElementCollection SourceElements
        {
            get
            {
                if (_sourceElements == null)
                {
                    _sourceElements = new JavaScriptSourceElementCollection();
                }

                return _sourceElements;
            }
        }


        public virtual string InheritedTypeName { get; set; }
        public virtual string Language { get; set; }
        public virtual bool Singleton { get; set; }
        public virtual string ScriptName { get; set; }


        private ScriptType _scriptType = ScriptType.Inline;
        public virtual ScriptType ScriptType
        {
            get { return _scriptType; }
            set { _scriptType = value; }
        }
        //------\\ Properties //--------------------------------------------//



        //------// Constructors \\------------------------------------------\\
        public JavaScriptCodeDom()
        { }
        //------\\ Constructors //------------------------------------------//



        //------// Methods \\-----------------------------------------------\\
        public virtual void AddSourceElement(int lineNumber, JavaScriptSourceElement sourceElement)
        {
            SourceElements.Add(lineNumber, sourceElement);
        }
        //------\\ Methods //-----------------------------------------------//
    }
}